import http from "@/api";
import { ResultPageData } from "@/api/interface/index";
export namespace Apis {
  export interface PermissionOut {
    permissionId: string; // 权限编号
    label: string; // 权限名称
    code: string; // 授权标识符
    remark: string; // 备注
  }
  export interface PermissionSearchVo {
    label: string; // 权限名称
    size: number; // 每页显示的数量
    current: number; // 当前页数
    keywords: string; // 关键字
  }
  export interface PermissionInsertVo {
    label: string; // 权限名称
    code: string; // 授权标识符
    remark: string; // 备注
  }
  export interface PermissionUpdateVo {
    permissionId: string; // 权限编号
    remark: string; // 备注
  }
}

//获取接口列表
export const getApisList = (params: Apis.PermissionSearchVo) => {
  return http.post<ResultPageData<Apis.PermissionSearchVo>>("/admin/permission/pageQuery", params);
};

// 根据Id查询接口定义
export const getApisById = (id: string) => {
  return http.get<Apis.PermissionOut>("/admin/permission/selectById", { id: id });
};

// 新增接口定义
export const addApis = (params: Apis.PermissionInsertVo) => {
  return http.post("/admin/permission/insert", params);
};

// 修改接口定义
export const updateApis = (params: Apis.PermissionUpdateVo) => {
  return http.post("/admin/permission/update", params);
};

// 删除接口定义
export const deleteApis = (id: string) => {
  return http.delete("/admin/permission/delete", { id: id });
};
